<?

include("main.php");

function showQuery( $id) 
{
    $query = getElementById("queries", 1);
    echo "<h1>".$query['query']."</h1><br>".$query['body']."<br>".$query['score'];
}

function showQueryForm()
{
    include("htmlincludes/queryForm.html");
}

function showCategories()
{
    foreach(getCategories(5) as $key => $category)
 echo "<a href='index.php?cat=".$category['enname']."' class='link'>".$category['name']."</a> ";

}


connectDB();

if($_GET['q'] == 'queryForm')
 showQueryForm();
elseif($_GET['q'] == 'categories')
 showCategories();
?>